/**
 * @author Shasha Chen
 */
public class MyTankManager
{
    private ThreeLives threeLives;
    private TwoLives twoLives;
    private OneLife oneLife;
    private DeadState deadState;
    private TankState currentState;
    
    final static int threel = 0;
    final static int twol = 1;
    final static int ol = 2;
    final static int ds = 3;
    

    
    
    public MyTankManager()
    {
        threeLives = new ThreeLives(this);
        twoLives = new TwoLives(this);
        oneLife = new OneLife(this);
        deadState = new DeadState(this);
        currentState = threeLives;
    }
    
    public String getState()
    {
        return currentState.getClass().getName();
    }
    

    public void setState (int state)
    {
        switch (state)
        {
            case threel: 
                currentState = threeLives; 
                break;
            case twol: 
                currentState = twoLives;  
                break;
            case ol: 
                currentState = oneLife; 
                break;
            case ds: 
                currentState = deadState; 
                break;    
            
        }
    }
    
    public void GetHit()
    {
        currentState.GetHit();
    }
}